// app.js
App({
  globalData: {
    userInfo: {},
    openid: null
  },

  // 保存登录信息
  _saveUserInfo: function (user) {
    this.globalData.userInfo = user;
    wx.setStorageSync('user', user)
  },

  // 获取当前的年月日
  _getNianYuiRi() {
    var date = new Date();
    var year = date.getFullYear();
    var mon = date.getMonth() + 1;
    var day = date.getDate();
    var submitTime = "";
    submitTime += year + '-';
    if (mon >= 10) {
      submitTime += mon + '-';
    } else {
      submitTime += "0" + mon + '-';
    }
    if (day >= 10) {
      submitTime += day;
    } else {
      submitTime += "0" + day;
    }
    return submitTime
  }
})